package com.itheima.stream流.多种获取方法;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class Test4 {
    public static void main(String[] args) {
        ArrayList<Integer> list1 = new ArrayList<>();
        for (int i = 1; i < 10; i++) {
            list1.add(i);
        }
        list1.add(10);
        list1.add(10);

        List<Integer>list=list1.stream().filter(number->number%2==0).collect(Collectors.toList());
        System.out.println(list);

        Set<Integer>set=list1.stream().filter(number->number%2==0).collect(Collectors.toSet());
        System.out.println(set);
    }
}
